package com.presalept.manipulatedata;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import com.presalept.polodo.ClientDO;

public class CreateClient {
	
	public static int InsertClient(ClientDO cdo) throws SQLException{
		
		Integer InsertResult = 0;
		
		Connection dbConn = null;
		PreparedStatement dbPreStmt = null;
	
		String dbSql = "Insert into clientinfo(clientname) values(?)";
		
		try{
			
			dbConn = DbManager.getConnection();
			
			dbPreStmt = dbConn.prepareStatement(dbSql);
			
			dbPreStmt.setString(1, cdo.getClientName());

	        InsertResult = dbPreStmt.executeUpdate();

			
		}finally{
			
			if (dbConn != null) dbConn.close();
			
		}

		return InsertResult;
		
	}

}
